package edu.gatech.coc.sirana.graph;

import edu.gatech.coc.sirana.parser.ClientLogItem;

public class ItemEdge {
	private ClientLogItem src;
	private ClientLogItem snk;
		
	public ItemEdge(ClientLogItem src, ClientLogItem snk){
		this.setSrc(src);
		this.setSnk(snk);
	}

	public ClientLogItem getSrc() {
		return src;
	}

	public void setSrc(ClientLogItem src) {
		this.src = src;
	}

	public ClientLogItem getSnk() {
		return snk;
	}

	public void setSnk(ClientLogItem snk) {
		this.snk = snk;
	}
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append(src.toString() + "\t=>" + snk.toString());
		
		return sb.toString();
	}

	public boolean isSame(ItemEdge currentBk) {
		boolean isSameSrc = this.getSrc().findAction().equals(currentBk.getSrc().findAction());
		boolean isSameSnk = this.getSnk().findAction().equals(currentBk.getSnk().findAction());
		
		return isSameSrc && isSameSnk;
	}
}
